#pragma once
#include <windows.h>

class CsLock
{
public:
	CsLock()	{
		::InitializeCriticalSection(&m_Cs);
	}
	~CsLock() {
		::DeleteCriticalSection(&m_Cs);
	}
public:
	void Lock() {
		::EnterCriticalSection(&m_Cs);
	}
	void Unlock() {
		::LeaveCriticalSection(&m_Cs);
	}
private:
	CRITICAL_SECTION m_Cs;
};